<template>
  <!-- <div class="content-box">
  <common-header :title="title"></common-header>-->
  <div
    class="page-content"
    v-infinite-scroll="loadMore"
    infinite-scroll-disabled="finish"
    infinite-scroll-distance="16"
  >
    <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
      <tarbar :list="list" />
      <table border="0" cellspacing="0" cellpadding="0">
        <thead>
          <tr>
            <th>时间</th>
            <th>类型</th>
            <th>金额</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(item,index) in dataList" :key="index">
            <td>{{item.create_time}}</td>
            <td>{{item.type}}</td>
            <td>{{item.amount}}</td>
          </tr>
          <tr v-if="!dataList.length">
            <td colspan="3">暂无数据</td>
          </tr>
        </tbody>
      </table>
    </van-pull-refresh>
    <!-- <v-table is-horizontal-resize style="width:100%" :columns="columns" :table-data="tableData"></v-table> -->
    <commonFooter></commonFooter>
  </div>
  <!-- </div> -->
</template>
<script>
import { commonFooter, tarbar } from "common";
import { accChangeApi } from "@/api/user";
import { createNamespacedHelpers } from "vuex";
import myMixin from "./listMixin";
let { mapActions } = createNamespacedHelpers("user");
export default {
  name: "recharge",
  components: {
    commonFooter,
    tarbar
  },
  mixins: [myMixin],
  methods: {
    ...mapActions(["GetBaseInfo"])
  },
  mounted() {
    this.findList = accChangeApi;
    this.GetBaseInfo().then(res => {
      // this.list[0].text = "¥" + 0;
      this.list[0].text = "¥" + res.data.userAmount;
    });
    // this.loadMore(()=>{
    //   this.finish=false
    // });
  },
  data() {
    return {
      title: "资金流水记录",
      list: [
        // { title: "累计金额(元)", text: "" },
        { title: "可用金额(元)", text: "" }
      ]
    };
  }
};
</script>
<style lang="less" scoped>
@import "~styles/variable.less";
table {
  border-collapse: collapse;
  width: 100%;
  text-align: center;
  margin: 0.5rem 0;
  font: 0.3rem/1.5 "Microsoft YaHei";
  color: #333;
  background: #fff;
  thead {
    background: #f6f4f5;
  }
  td,
  th {
    min-width: 0.2rem;
    border: 1px #ddd solid;
    max-width: 5rem;
    padding: 0.2rem 0;
    word-wrap: break-word;
    word-break: break-all;
  }
}
</style>